package com.heima.test2;

import javax.swing.*;
import java.awt.*;

public class MyJFrame extends JFrame {
    public MyJFrame() throws HeadlessException {
        init();
    }

    private void init() {
        this.setSize(600,400);
        this.setResizable(false);
        this.setLocationRelativeTo(null);
        this.setLayout(new BorderLayout(30,30));
        JButton jb1 = new JButton("济南黑马");
        JButton jb2 = new JButton("学习前端");
        JButton jb3 = new JButton("学习PHP");
        JButton jb4 = new JButton("学习测试");
        JButton jb5 = new JButton("学习Java");
        this.add(jb1,BorderLayout.NORTH);
        this.add(jb2,BorderLayout.EAST);
        this.add(jb3,BorderLayout.SOUTH);
        this.add(jb4,BorderLayout.WEST);
        this.add(jb5,BorderLayout.CENTER);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
    }
}
